import requests, random
from threading import Thread
# 线程实例
def stock_func():
    url1 = 'http://127.0.0.1:8000/v1/stock'
    url2 = 'http://127.0.0.1:8001/v1/stock'
    url = random.choice([url1, url2])
    resp = requests.get(url=url)
    print(resp.url)
t_list = []
for i in range(310):
    t = Thread(target=stock_func)
    t_list.append(t)
    t.start()

for item in t_list:
    t.join()